package com.novax.ex.activity.open.api;

import com.novax.ex.common.results.ReturnResult;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestHeader;

/**
 * summary: 前台-排名赛报名
 *
 * @author shaw
 * @date 11/30/22 11:14
 */
@Tag(name = "前台-排名赛报名", description = "前台-排名赛报名")
@FeignClient(url = "${remote.activity-service.endpoint}", name = "RankApplyApi", contextId = "RankApplyApi")
public interface RankApplyApi {

    @Operation(summary = "报名")
    @PostMapping("/v3/rank-apply/{rankId}")
    ReturnResult<?> apply(@RequestHeader("language") String language,
                          @RequestHeader("userId") Long userId,
                          @PathVariable("rankId") Long rankId);

    @Operation(summary = "查看是否已报名")
    @GetMapping("/v3/{rankId}/rank-apply")
    ReturnResult<Boolean> queryApply(@RequestHeader("userId") Long userId,
                                     @PathVariable("rankId") Long rankId);



}